{% extends 'staff/report/base.html' %} {% load i18n %} {% block opts_modify %} var cols = [[ {field:'emp_code', width:120, title: "{% trans 'report_column_empCode' %}", sort:true} ,{field:'first_name', title: "{% trans 'report_column_firstName' %}"} ,{field:'last_name', title: "{% trans 'report_column_lastName' %}", hide: true} ,{field:'nick_name', title: "{% trans 'report_column_nickName' %}", hide: true} ,{field:'gender', title: "{% trans 'report_column_gender' %}", hide: true} ,{field:'dept_code', title: "{% trans 'report_column_departmentCode' %}", hide: true} ,{field:'dept_name', width:140, title: "{% trans 'report_column_departmentName' %}"} ,{field:'position_code', title: "{% trans 'report_column_positionCode' %}", hide: true} ,{field:'position_name', title: "{% trans 'report_column_positionName' %}", hide: true} ,{field:'total_late', width:80, title: "{% trans 'report_column_lateDuration' %}"} ,{field:'total_early_leave', width:100, title: "{% trans 'report_column_earlyLeaveDuration' %}"} ,{field:'total_absent', width:80, title: "{% trans 'report_column_absentDuration' %}"} ,{field:'total_worked', title: "{% trans 'report_column_actualWorkDuration' %}"} ,{field:'total_not', title: "{% trans 'report_column_normalOvertime' %}"} ,{field:'total_wot', title: "{% trans 'report_column_weekendOvertime' %}"} ,{field:'total_hot', title: "{% trans 'report_column_holidayOvertime' %}"} ,{field:'total_dot', title: "{% trans 'report_column_dayoffOvertime' %}"} ,{field:'total_leave', title: "{% trans 'report_column_leaveDuration' %}"} ]]; $.ajax({ url: "/att/leaveCategory/" ,type: "GET" ,dataType: "json" ,async: false ,success:function(response){ var data = response.data; data.forEach(function(col, index){ cols[0].push({field: 'Leave_'+col[0], title: col[1], hide: true}) }); //table.reload(tb.config.id, {cols: cols, url: "/att/api/report/dailyattendance_report/"}); } ,error:function(){ } }); $.extend(opts, { cols: cols ,method: "get" ,url: "/att/api/empSummaryReport/" }); {% endblock %}